﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    [Table("SysMenuFunc")]
    public class SysMenuFunc : BaseEntity
    {
        public enum EnumSysMenuFuncStatus
        { 启用, 禁用 };

        [Key]
        [Column(TypeName = "uuid")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid MenuFuncId { get; set; }

        [Column(TypeName = "uuid")]
        public Guid MenuId { get; set; }

        [Column(TypeName = "uuid")]
        public Guid AppId { get; set; }

        [Required]
        [Column(TypeName = "varchar(32)")]
        public string Name { get; set; }

        [Column(TypeName = "varchar(5000)")]
        public string Description { get; set; }

        [Column(TypeName = "varchar(500)")]
        public string Component { get; set; }

        [Column(TypeName = "varchar(5000)")]
        public string Icon { get; set; }

        [Column(TypeName = "varchar(500)")]
        public string Apis { get; set; }

        [Required]
        [Column(TypeName = "int4")]
        public EnumSysMenuFuncStatus Status { get; set; }

        [ForeignKey("MenuId")]
        public virtual SysMenu SysMenu { get; set; }

        public virtual ICollection<SysRolePermission> SysRolePermissions { get; set; }
    }
}